// 变量
def version = 1
println "version=" + version
// 字符串
def s1 = 'gradle-demo'
def s2 = "gradle version is ${version}"
def s3 = '''This is my first 
groovy program'''
println s1
println s2
println s3
// list
def buildTools = ['ant', 'maven']
buildTools << 'gradle'
assert buildTools.getClass() == ArrayList
assert buildTools.size() == 3
// LinkHashMap
def buildYears = ['ant': 2000, 'maven': 2004]
buildYears.gradle = 2009
println buildYears.ant
println buildYears['gradle']
assert buildYears.getClass() == LinkedHashMap
// 闭包
def c1 = {
    v -> print v
}
def c2 = {
    print 'hello'
}
def method1(Closure closure){
    closure('param')
}
def method2(Closure closure){
    closure()
}
method1(c1)
method2(c2)